using System;
using System.Collections.Generic;
using System.Text;
//using System.Data.SQLite;

using MyCollections.Model;
using System.Data;

namespace MyCollections.DataBase
{
    /*class SQLite_Movie: SQLite
    {
        #region SQLite Members

        public void save(Movie obj)
        {

            // We use these three SQLite objects:
            SQLiteConnection sqlite_conn;
            SQLiteCommand sqlite_cmd;
            SQLiteDataReader sqlite_datareader;

            int i = 0;

            // create a new database connection:
            sqlite_conn = new SQLiteConnection("Data Source=collections.db;Version=3;New=True;Compress=True;");

            // open the connection:
            sqlite_conn.Open();

            // create a new SQL command:
            sqlite_cmd = sqlite_conn.CreateCommand();

            // Let the SQLiteCommand object know our SQL-Query:
            sqlite_cmd.CommandText = 
                "INSERT INTO MovieImdb "+
                "(id, "+
                "title, "+
                "year, "+
                "director, "+
                "writer, "+
                "tagline, "+
                "plot, "+
                "certification, "+
                "language, "+
                "color, "+
                "sound, "+
                "country, "+
                "url, "+
                "data, "+
                "genre, "+
                "picture, "+
                "actors, "+
                "comments) VALUES (" +
                "'" + obj.imdb.id + "', " +
                "'" + obj.imdb.title + "', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', " +
                "'', ";

            // Now lets execute the SQL ;D
            sqlite_cmd.ExecuteNonQuery();

            // Now the SQLiteCommand object can give us a DataReader-Object:
            sqlite_datareader = sqlite_cmd.ExecuteReader();

            // The SQLiteDataReader allows us to run through the result lines:
            while (sqlite_datareader.Read()) // Read() returns true if there is still a result line to read
            {
                // Print out the content of the text field:
                System.Console.WriteLine(sqlite_datareader["text"]);
            }

            // We are ready, now lets cleanup and close our connection:
            sqlite_conn.Close();
            
        }

        /*public Movie SQLite.load(int id)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public Movie SQLite.search(string query)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }*/
}
